<template>
	<view class="nucleic-report-container">
		<!-- 患者和检测申请信息 -->
		<view class="report-section">
			<view class="detail-item">
				<text class="label">姓名</text>
				<text class="value">{{ reportData.name }}</text>
			</view>
			<view class="detail-item">
				<text class="label">身份证号</text>
				<text class="value">{{ reportData.idNumber }}</text>
			</view>
			<view class="detail-item">
				<text class="label">年龄</text>
				<text class="value">{{ reportData.age }}</text>
			</view>
			<view class="detail-item">
				<text class="label">送检查科室</text>
				<text class="value">{{ reportData.department }}</text>
			</view>
			<view class="detail-item">
				<text class="label">申请医师</text>
				<text class="value">{{ reportData.physician }}</text>
			</view>
			<view class="detail-item">
				<text class="label">标本种类</text>
				<text class="value">{{ reportData.specimenType }}</text>
			</view>
			<view class="detail-item">
				<text class="label">标本编号</text>
				<text class="value">{{ reportData.specimenNumber }}</text>
			</view>
			<view class="detail-item">
				<text class="label">检测方法</text>
				<text class="value">{{ reportData.detectionMethod }}</text>
			</view>
			<view class="detail-item">
				<text class="label">采样日期</text>
				<text class="value">{{ reportData.samplingDate }}</text>
			</view>
		</view>
		
		<!-- 检测报告 -->
		<view class="report-section">
			<view class="section-title">检测报告</view>
			<view class="detail-item">
				<text class="label">项目</text>
				<text class="value">{{ reportData.testItem }}</text>
			</view>
			<view class="detail-item">
				<text class="label">检测结果</text>
				<text class="value result-negative">{{ reportData.testResult }}</text>
			</view>
		</view>
		
		<!-- 报告日期和人员 -->
		<view class="report-section">
			<view class="detail-item">
				<text class="label">采样日期</text>
				<text class="value">{{ reportData.samplingDateShort }}</text>
			</view>
			<view class="detail-item">
				<text class="label">报告日期</text>
				<text class="value">{{ reportData.reportDate }}</text>
			</view>
			<view class="detail-item">
				<text class="label">检验人员</text>
				<text class="value">{{ reportData.testingPersonnel }}</text>
			</view>
			<view class="detail-item">
				<text class="label">审核人员</text>
				<text class="value">{{ reportData.reviewingPersonnel }}</text>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			reportData: {
				name: '蒋峰',
				idNumber: '378909199870098978',
				age: '24岁',
				department: '保健科',
				physician: '王静',
				specimenType: '鼻咽拭子',
				specimenNumber: '123476',
				detectionMethod: '实时荧光定量(PCR)技术',
				samplingDate: '2020-09-09 10:00',
				samplingDateShort: '2020-09-09',
				testItem: '新型冠状病毒核酸检测',
				testResult: '阴性',
				reportDate: '2020-09-09',
				testingPersonnel: '王静',
				reviewingPersonnel: '李凤'
			}
		}
	},
	onLoad(options) {
		if (options.data) {
			try {
				const data = JSON.parse(decodeURIComponent(options.data))
				// 根据传入的数据更新报告信息
				console.log('接收到的数据:', data)
			} catch (e) {
				console.error('解析数据失败:', e)
			}
		}
	}
}
</script>

<style scoped>
.nucleic-report-container {
	background-color: #f5f5f5;
	min-height: 100vh;
	padding: 20rpx;
}

.report-section {
	background-color: #ffffff;
	border-radius: 12rpx;
	padding: 30rpx;
	margin-bottom: 20rpx;
	box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
}

.section-title {
	font-size: 32rpx;
	font-weight: bold;
	color: #333;
	margin-bottom: 20rpx;
	padding-bottom: 15rpx;
	border-bottom: 1rpx solid #f0f0f0;
}

.detail-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20rpx;
}

.detail-item:last-child {
	margin-bottom: 0;
}

.label {
	font-size: 28rpx;
	color: #666;
	width: 140rpx;
}

.value {
	font-size: 28rpx;
	color: #333;
	flex: 1;
	text-align: right;
}

.result-negative {
	color: #4CAF50;
	font-weight: bold;
}
</style> 